<template>
  <div class="chat-checkbox">
    <input
      :id="id"
      :name="name"
      v-model="value"
      @change="check"
      class="checklist"
      type="checkbox"
    />
    <label :for="forId"></label>
  </div>
</template>

<script>
export default {
  name: 'chatCheckBox',
  props: {
    id: {
      type: String,
    },
    forId: {
      type: String,
    },
    name: {
      type: String
    },
    vModelValue: {
      type: Boolean
    }
  },
  data() {
    return {
      value: this.vModelValue
    }
  },
  methods: {
    check(e) {
      this.$emit('change', e)
    }
  },
  watch: {
    vModelValue(newVal) {
      this.value = newVal
    }
  }
}
</script>

<style lang="scss" scoped>
@import '@css/globalCite/defaultVariable.scss';
@import '@css/globalCite/defaultThemeVariable.scss';
@import '@css/globalCite/themeMixin.scss';
@import '@css/globalCite/bgImageMixin.scss';
@import '@css/components/chatCheckbox/fyChatCheckbox.scss'; 
</style>